<{include file="section/admin/admin_header.tpl"}>
<body>
<{include file="section/admin/admin_header_login_bar.tpl"}>
<div id="contentA" class="clear" style="width:1300px;">
	<!--leftsidebar sr-->
	<{include file="section/admin/admin_left_sidebar.tpl"}>
    <!--/leftsidebar end-->
    <div class="rightCont">
    	<!--path st-->
        <div class="path">您的位置：<a href="/">首页</a>&gt; &nbsp;商家列表</div>
        <!--/path end-->
    	<h2 class="title01"><span>商家列表</span></h2>
        <div class="line1"></div>
		<!--box02 st-->
        <div class="box02">
            <div class="box02_1">
                <div class="search02 clear">
                	<form action="/merchant/search" id="frm_query" method="get">
                    <ul>
                    <li class="mr5">商家账户：<input type="text" id="login_name" name="login_name" class="in2" onblur="this.className='in2';if(this.value=='') this.value='填写商家姓名或者账号';" onfocus="this.className='in1';if(this.value=='填写商家姓名或者账号') this.value='';" value="填写商家姓名或者账号" size="20" /></li>
					<li>
					<li>商铺状态：<select name="shop_status" id="shop_status">
									<option value="">请选择状态</option>
									<option value="1" <{if $status == 1}>selected="true"<{/if}>>已开通</option>
									<option value="2" <{if $status == 2}>selected="true"<{/if}>>未开通</option>
					</select> 
					</li>
					<!--<li>注册时间： <input type="text" class="in2" style="width:70px;" id="begin_time" size="10" name="begin_time" value='<{$start_time}>' /> 
				    <input type="text" class="in2" style="width:70px;" id="end_time" size="10" name="end_time" value='<{$end_time}>' /> -->
					<input type="submit" value="查询" class="btn01" />
                    <input type="reset" value="清空" class="btn02" /></li> 
					</ul>
          			</form>
                </div>
				<form id="frm_del" action="/merchant/del_merchant" method="post">
				<input type="hidden" value="" name="login_name">
				<input type="hidden" value="del" name="action">
                <div class="box02_Tab">
                	<div class="table01">
                    	<table cellpadding="0" cellspacing="0" width="100%" border="0" id="table">
                        <tr class="th">
                        <!-- <th><div>&nbsp;</div></th>-->
                        <th><div class="tl">账号</div></th>
                        <th><div>店铺名称</div></th>
                        <th><div>品牌详情</div></th>
                        <th><div>商品列表</div></th>
                        <th><div>交易列表</div></th>
                        <th><div>注册时间</div></th>
						<th>状态</th>
                        <th>操作</th>
						<th>日流量</th>
						</tr>

						<{foreach from=$data key=key item=item}>
						<tr>
                       <!-- <td><input name="u_<{$item.uid}>" type="checkbox" value="1" onclick="select_one(this);"/></td>-->
						<td class="tl"><a href="http://<{$sub_domain}>/member/detail/<{$item.uid}>" target="_blank"><{$item.passport}></a></td>
                        <td><a href="http://<{$sub_domain}>/shop/detail/<{$item.shop_id}>" target="_blank"><{if $item.shop_name}><{$item.shop_name}><{else}><{$item.shop_short_name}><{/if}></a></td>
                        <td><a href="http://<{$sub_domain}>/brands/list/?merchant_id=<{$item.uid}>" target="_blank">查看品牌</a></td>
                        <td><a href="http://<{$sub_domain}>/goods/lists/<{$item.uid}>" target="_blank">查看商品</a></td>
                        <td><a href="http://<{$sub_domain}>/orders/list/?merchant_id=<{$item.uid}>" target="_blank">查看交易</a></td>
						<td><{$item.create_time}></td>
						<td><{$item.open_status}></td>
                        <td><{if $item.open_status == '已开通'}><a href="javascript:void(0);" onclick="close_shop(<{$item.shop_id}>, 'invalid');" style="color:red;">关闭店铺</a><{else}><{if $item.shop_status}><a href="javascript:void(0);" onclick="close_shop(<{$item.shop_id}>, 'valid');" style="color:green;">开通已关闭店铺</a><{else}><a href="/merchantapply/detail/<{$item.shop_id}>">去审核</a><{/if}><{/if}></td>
						<td><a href="http://<{$sub_domain}>/statis/dailyshop/<{$item.shop_id}>" target="_blank">查看</a></td>
						</tr>
						<{/foreach}>

                        </table>
                    </div>
                </div>
                <div class="box02_lab clear">
                    </div>
				</form>
                <div class="page clear">
                	共计：<{$total}> &nbsp; <{$pagination}>
                </div>
            </div>
        </div>
        <!--/box02 end-->
        
    </div>
</div>
</body>
<script type="text/javascript">

var login_name = '<{$login_name}>';
if(login_name)
	document.getElementById('login_name').value	= login_name;

function close_shop(id, str)
{
	var id	= parseInt(id);

	if(id <=0 )
	{
		alert('参数错误');

		return false;
	}else{

		$.post('/merchant/close',
		{
				shop_id : id,
				shop_status  : str 
		},
		function(o){
			
			window.location.href = window.location.href;
								
		},
		'html'
		);

	}
}
</script>
</html>
